import { post, get } from '@/utils/request';
import type { ApiResponse } from '@/types/api';

/**
 * 支付相关API
 */
export class PayAPI {
  /**
   * 创建订单
   * @param params 创建订单参数
   * @returns Promise<CreateOrderResponse>
   */
  static async createOrder(params: any): Promise<any> {
    const response = await post<any>('/pay/create_order', params);
    return response.data;
  }

  /**
   * 查询订单状态
   * @param orderId 订单ID
   * @returns Promise<OrderStatusResponse>
   */
  static async getOrderStatus(orderId: string): Promise<any> {
    const response = await post<any>(`/pay/get_order`, { order_id: orderId });
    return response.data;
  }
}
